package core.module.playCenter
{
	import core.util.ConfigUtil;
	
	import flash.utils.getDefinitionByName;
	
	import mx.core.UIComponent;
	
	public class CardFactory
	{
		public function CardFactory()
		{
		}
		
		public static function buildCard(type:String):SuperCard
		{
			var sprite:Class;
			try
			{
				sprite = getDefinitionByName(ConfigUtil.getInstance().getCardClass(type)) as Class;
			}
			catch(e:Error)
			{
				sprite = getDefinitionByName("flash.display.Sprite") as Class;
			}
			var uc:SuperCard = new SuperCard(type);
			uc.addChild(new sprite());
			return uc;
		}
	}
}